<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/static/include/taglib.jsp"%>
<!DOCTYPE html >
<html>
<head>
 <meta name="viewport" content="width=device-width" />
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
 <title>后台管理--模板编辑</title>
 <link href="${ctxStatic}/layui/css/layui.css" rel="stylesheet" />
 <link href="${ctxStatic}/css/kpiuitanchu.css" rel="stylesheet" />
 <script src="${ctxStatic}/js/jquery-1.8.3.min.js?v=2.0" type="text/javascript"></script>
 <script src="${ctxStatic}/layui/layui.all.js"  type="text/javascript"></script>
</head>
<body>
 <div class="tanchucontent">
   <form class="layui-form" id="formedit" name="formedit" action="add_templateindex" method="post" target="d41d8cd98f00b204e9800998ecf8427e">
    <iframe name="d41d8cd98f00b204e9800998ecf8427e" src="about:blank" style="display:none;"></iframe>
     <table>
      <tr>
       <td class="td_right">类型：</td>
       <td>
        <c:if test="${entity.assindextype == 0}">
         <input type="radio" name="assindextype" value="0" title="内容" checked="">
         <input type="radio" name="assindextype" value="1" title="指标">
        </c:if>
        <c:if test="${entity.assindextype == 1}">
         <input type="radio" name="assindextype" value="0" title="内容" >
         <input type="radio" name="assindextype" value="1" title="指标" checked="">
        </c:if>
         
         <!-- <input type="radio" name="assindextype" value="2" title="标准"> -->
       </td>
      </tr>
      <tr>
       <td class="td_right">上级：</td>
       <td>
         <select name="parentid" lay-verify="required">
                <option value="0">请选择上级</option>
                <c:forEach var="item" items="${lst}">
                 <c:if test="${entity.parentid == item.assindexid}">
                  <option selected="selected" value="${item.assindexid}">${item.uasscontent}</option>
                 </c:if>
                 <c:if test="${entity.parentid != item.assindexid}">
                  <option value="${item.assindexid}">${item.uasscontent}</option>
                 </c:if>
                  
                </c:forEach>
              </select>
       </td>
      </tr>
       <tr>
       <td class="td_right">内容：</td>
       <td>
        <c:if test="${entity.assindextype == 0}">
         <input type="text" name="uasscontent" lay-verify="required" autocomplete="off" class="layui-input" value="${entity.uasscontent }" >
        </c:if>
        <c:if test="${entity.assindextype == 1}">
         <input type="text" name="uasscontent" lay-verify="required" autocomplete="off" class="layui-input" value="${entity.uassingredients }" >
        </c:if>
         
       </td>
      </tr>
       <tr>
       <td class="td_right">分数：</td>
       <td>
        <input type="text" name="score" lay-verify="required|number" autocomplete="off" class="layui-input" value="${entity.score }" >
       </td>
      </tr>
       <tr>
       <td class="td_right">评价标准：</td>
       <td>
         <textarea class="layui-textarea"  name="evaluationstandard" >${entity.evaluationstandard }</textarea>
       </td>
      </tr>
       <tr>
       <td colspan="2" style="text-align: center;padding-top:10px">
         <button class="button" lay-submit="" lay-filter="demo1" id="btnsave">保存</button>
		 <input type="button" value="关闭" class="button" onclick="top.CloseOpenWindow()"/>
       </td>
      </tr>
     </table>

    <input type="hidden" name="assindexid" id="assindexid" value="${entity.assindexid }"/>
    
    
  </form>
  
  <script>
  layui.use('form', function(){
	 var form = layui.form;
	 
	 form.on('submit(demo1)', function(data){
		 if(data.field.assindextype==1){
			 if(data.field.parentid==0){
				 alert('请选择上级');
				 return false;
			 }
		 }
		 else{
			 if(data.field.parentid!=0){
				 alert('内容项不需要上级');
				 return false;
			 }
		 }
		 return true;
	 })
	 
	 form.render();
  });
 
 function CloseDialog(result,msg){
	  //top.frames["iframe"].vTemplate.addresult(result,msg);
	 top.frames["iframe"].vBJxIndex.addresult(result,msg);
 }
  </script>
 </div>
</body>
</html>